﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Benefit.Service.Sys
{
    public class ServiceOperatorStatus : Benefit.Interface.Sys.IOperatorStatus
    {
        Benefit.DB.DBManager db = null;
        public ServiceOperatorStatus(Benefit.DB.DBManager db)
        {
            this.db = db;
        }
        /// <summary>
        /// 得到交易员状态
        /// </summary>
        /// <returns></returns>
        public Models.Sys._OperatorStatus GetOperatorStatus(double operatorDayProfit)
        {
            Models.Sys._OperatorStatus Status = 0;
            if (operatorDayProfit > 50000)
            {
                Status = Models.Sys._OperatorStatus.VeryGood;
            }
            else if (operatorDayProfit <= 50000 && operatorDayProfit > 3000)
            {
                Status = Models.Sys._OperatorStatus.Good;
            }
            else if (operatorDayProfit <= 3000 && operatorDayProfit > -2000)
            {
                Status = Models.Sys._OperatorStatus.Poor;
            }
            else if (operatorDayProfit <= -2000 && operatorDayProfit > -5000)
            {
                Status = Models.Sys._OperatorStatus.VeryPoor;
            }
            else
            {
                Status = Models.Sys._OperatorStatus.MostPoor;

            }
            return Status;
        }


        public string GetOperatorStatus(Models.Sys._OperatorStatus status)
        {
            string Status = "";
            if (status == Models.Sys._OperatorStatus.VeryGood)
            {
                Status = "非常好";
            }
            if (status == Models.Sys._OperatorStatus.Good)
            {
                Status = "较好";
            }
            if (status == Models.Sys._OperatorStatus.Poor)
            {
                Status = "较差";
            }
            if (status == Models.Sys._OperatorStatus.VeryPoor)
            {
                Status = "非常差";
            }
            if (status == Models.Sys._OperatorStatus.MostPoor)
            {
                Status = "极差";
            }
            return Status;
        }
    }
}
